<!-- css -->

<div class="container" style="padding-top: 50px;">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <form class="form-horizontal" role="form" id="post_form" action="{:U('')}">
                <div class="form-group">
                    <label for="code" class="col-sm-2 control-label">券码:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="code" id="code" value="{$info['code']|default=''}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="money" class="col-sm-2 control-label">金额:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="number" min="0" class="form-control" name="money" id="money" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" class="btn btn-primary" id="btn" lng="0" lat="0">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#btn").click(function () {
            var $form = $("#post_form");
            var $data = {};
            var $form_data = $form.serializeArray();
            $.each($form_data, function (k, v) {
                $data[v.name] = v.value;
            });
            $.post($form.attr('action'), $data, function (obj) {
                alert(obj.m);
                if (obj.s) {
                    if (typeof (obj.url) != "undefined" && obj.url) {
                        location.href = obj.url;
                    }
                }
            });
            return false;
        });
    });
</script>